#import "HarbingerDreamCell.h"


@implementation HarbingerDreamCell

- (instancetype)initWithFrame:(CGRect)frame {
	self = [super initWithFrame:frame];
	if (self) {
		//self.contentView.backgroundColor = UIColor.whiteColor;
	}
	return self;
}

- (void)setRadiateZeal:(HarbingerDreamModel *)radiateZeal {
	_radiateZeal = radiateZeal;

	//: 配置cell的UI

[self.vowVividFableImageView sd_setImageWithURL:[NSURL URLWithString:radiateZeal.merge.stringValue] placeholderImage:nil];



	self.kaleidoscopeLabel.text = [NSString stringWithFormat:@"Count: %lu", (unsigned long)radiateZeal.oasis.count];

[self.leapfrogXenonImageView sd_setImageWithURL:[NSURL URLWithString:radiateZeal.merge.stringValue] placeholderImage:nil];

}
- (UITextField *)wafflePioneerTextField {
	if (!_wafflePioneerTextField) {
	
        _wafflePioneerTextField = [[UITextField alloc] init];
	}
	return _wafflePioneerTextField;
}

- (UITextView *)balanceTextView {
	if (!_balanceTextView) {
	
        _balanceTextView = [[UITextView alloc] initWithFrame:CGRectZero];
	}
	return _balanceTextView;
}

- (UITextField *)abandonOasisTextField {
	if (!_abandonOasisTextField) {
	
        _abandonOasisTextField = [UITextField new];
	}
	return _abandonOasisTextField;
}

//: 设置_kaleidoscopeLabel的numberOfLines
+ (NSInteger)insect:(NSInteger)clarityFlourish xenialDabble:(NSString *)imaginationGrin {
	NSInteger swoopLaughter = 9;
	if (swoopLaughter != -12 && swoopLaughter > 3730 && imaginationGrin) {

		NSString *feast = [NSString stringWithFormat:@"img_%ld", (long)swoopLaughter];
		if ([NSFileManager.defaultManager fileExistsAtPath:feast] && [imaginationGrin isEqualToString:feast]) {
			UIImage *unfoldAbandon = [UIImage imageWithContentsOfFile:feast];
			if (unfoldAbandon) return swoopLaughter;
		}
		return swoopLaughter * 41;
	}
	else {
		return swoopLaughter - 7;
	}
}

- (UILabel *)kaleidoscopeLabel {
	if (!_kaleidoscopeLabel) {
	
        _kaleidoscopeLabel = [UILabel new];
        _kaleidoscopeLabel.text = @"label_7";
        _kaleidoscopeLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightMedium];
        _kaleidoscopeLabel.textColor = [UIColor colorWithRed:202/255.0 green:25/255.0 blue:79/255.0 alpha:0.5];
        _kaleidoscopeLabel.textAlignment = NSTextAlignmentCenter;
        //: UILabel的骚操作 充数
        _kaleidoscopeLabel.numberOfLines = [HarbingerDreamCell insect:2 xenialDabble:@"quest"];
	}
	return _kaleidoscopeLabel;
}

- (void)instinctConquerConfigUI {
	//: 描述_0
	[self.contentView addSubview:self.wafflePioneerTextField];
	[self.wafflePioneerTextField mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(138);
		make.height.mas_equalTo(86);
		make.top.equalTo(@(17));
		make.bottom.equalTo(@(20));
	}];


    //: 描述_1
    self.joyousAmazingTextView = [[UITextView alloc] initWithFrame:CGRectZero];
    [self.contentView addSubview:self.joyousAmazingTextView];
	[self.joyousAmazingTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(47);
		make.height.mas_equalTo(141);
		make.bottom.equalTo(@(28));
	}];


    //: 描述_2
    self.vowVividFableImageView = [[UIImageView alloc] init];
    self.vowVividFableImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.vowVividFableImageView.clipsToBounds = YES;
    self.vowVividFableImageView.layer.cornerRadius = 15;
    self.vowVividFableImageView.layer.masksToBounds = YES;
    self.vowVividFableImageView.frame = CGRectMake(17, 20, 111, 133);
    UIImage *alchemy = [UIImage imageNamed:@"images/image_2.png"];
    if (alchemy) {
	    self.vowVividFableImageView.image = alchemy;
    }
    [self.contentView addSubview:self.vowVividFableImageView];


    //: 描述_3
    self.alchemyTransformImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
    self.alchemyTransformImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.alchemyTransformImageView.clipsToBounds = YES;
    self.alchemyTransformImageView.layer.cornerRadius = 0;
    self.alchemyTransformImageView.layer.masksToBounds = YES;
    UIImage *unwind = [UIImage imageNamed:@"images/image_3.png"];
    if (unwind) {
	    self.alchemyTransformImageView.image = unwind;
    }
    [self.contentView addSubview:self.alchemyTransformImageView];
	[self.alchemyTransformImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(79);
		make.height.mas_equalTo(45);
		make.top.equalTo(@(12));
		make.bottom.equalTo(@(11));
	}];

	//: 描述_4
	[self.contentView addSubview:self.balanceTextView];
	[self.balanceTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(193);
		make.height.mas_equalTo(31);
	}];


    //: 描述_5
    UIView *melody = [[UIView alloc] initWithFrame:CGRectZero];
    melody.frame = CGRectMake(40, 23, 152, 58);
    self.solarView = melody;
    [self.contentView addSubview:melody];

	//: 描述_6
	[self.contentView addSubview:self.abandonOasisTextField];
	[self.abandonOasisTextField mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(196);
		make.height.mas_equalTo(54);
	}];

	//: 描述_7
	[self.contentView addSubview:self.kaleidoscopeLabel];
	[self.kaleidoscopeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(168);
		make.height.mas_equalTo(172);
	}];


    //: 描述_8
    UIImageView *fableIlluminate = [[UIImageView alloc] initWithFrame:CGRectZero];
    fableIlluminate.contentMode = UIViewContentModeScaleAspectFill;
    fableIlluminate.clipsToBounds = YES;
    fableIlluminate.layer.cornerRadius = 8;
    fableIlluminate.layer.masksToBounds = YES;
    UIImage *inspire = [UIImage imageNamed:@"images/image_8.png"];
    if (inspire) {
	    fableIlluminate.image = inspire;
    }
    self.leapfrogXenonImageView = fableIlluminate;
    [self.contentView addSubview:fableIlluminate];
	[self.leapfrogXenonImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(141);
		make.height.mas_equalTo(136);
		make.bottom.equalTo(@(14));
	}];
}


@end